package com.tom.imooc.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author zx
 * @date 2024-09-05 12:30
 */
@ConfigurationProperties(prefix = DynamicDataSourceProperty.PREFIX)
public class DynamicDataSourceProperty {
    public static final String PREFIX = "customer.datasource.dynamic";

    private String primary;

    public String getPrimary() {
        return primary;
    }

    public void setPrimary(String primary) {
        this.primary = primary;
    }

    private Map<String,DataSourceProperty> datasource = new LinkedHashMap<>();

    public Map<String, DataSourceProperty> getDatasource() {
        return datasource;
    }

    public void setDatasource(Map<String, DataSourceProperty> datasource) {
        this.datasource = datasource;
    }

    @Override
    public String toString() {
        return "DynamicDataSourceProperty{" +
                "primary='" + primary + '\'' +
                ", datasource=" + datasource +
                '}';
    }
}
